import * as actionTypes from './actionTypes';
import axios from 'axios';

const setRoomList = (data)=>({
    type: actionTypes.SET_ROOM_LIST,
    data: data
})
export const getRoomList = ()=>{
    return (dispatch)=>{
        axios.get('http://49.233.20.202:3001/Room/getRooms').then((res)=>{
            dispatch(setRoomList(res.data.data));
        })
    }
}
const setBellList = (data)=>({
    type: actionTypes.SET_BELL_LIST,
    data: data
})
export const getBellList = ()=>{
    return (dispatch)=>{
        axios.get('http://49.233.20.202:3001/Room/getBellList').then((res)=>{
            dispatch(setBellList(res.data.data));
        })
    }
}